[Bug]: Discrepancy of extended Token with legacy library
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Bắt đầu bằng cách chạy các ví dụ Python trong issue và so sánh OpenPAYGOTokenEncoder.generate_token với legacy generate_extended_token cho một token ADD_TIME mở rộng. Theo dõi cách loại và số lượng token được xử lý trong chế độ mở rộng, sau đó xác minh kết quả dựa trên đầu ra legacy hoặc một hành vi mong đợi đã được xác nhận rõ ràng. Issue không nêu tên tệp hay bài kiểm thử nào trong repository.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Preflight Checklist
- I have read the Contributing Guidelines for this project, if it exists.
- I agree to follow the Code of Conduct that this project adheres to.
- I have searched the issue tracker for a feature request that matches the one I want to file, without success.
Expected Behavior
Legacy and new library should generate the same extended tokens.
Actual Behavior
When generating extended tokens there is a difference for ADD_TIME tokens.
New lib:
# OpenPAYGO-python
from openpaygo import OpenPAYGOTokenEncoder, TokenType
encoder = OpenPAYGOTokenEncoder()
new_count, final_token = encoder.generate_token(
secret_key="bc41ec9530f6dac86b1a29ab82edc5fb",
count=2,
value=1,
token_type=TokenType.ADD_TIME,
starting_code=516959010,
restricted_digit_set=False,
extended_token=True,
)
print(f"{new_count=}")
print(f"{final_token=}")
yields
new_count=4
final_token='584694959011'
Legacy:
# OpenPAYGO Token
import codecs
from importlib import import_module
openpaygo_token = import_module("openpaygo-token")
encoder = openpaygo_token.OPAYGOEncoder()
shared = openpaygo_token.OPAYGOShared
new_count, final_token = encoder.generate_extended_token(
key=codecs.decode("bc41ec9530f6dac86b1a29ab82edc5fb", "hex"),
count=2,
value=1,
# mode=shared.TOKEN_TYPE_ADD_TIME,
starting_code=516959010,
restricted_digit_set=False,
)
print(f"{new_count=}")
print(f"{final_token=}")
new_count=3
final_token='660362959011'
Steps to reproduce
Run the code from above.
This might be related to the legacy being hardcoded to SET_TIME for extended mode. Is the expected behaviour?
What operating system(s) are you using?
macOS
Additional Information
No response
- Ngôn ngữ chính
- Python
- Star
- 15
- Fork
- 15
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của EnAccess/OpenPAYGO-python
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
EnAccess/OpenPAYGO-python#34 ·
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
EnAccess/OpenPAYGO-python#25 ·
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
EnAccess/OpenPAYGO-python#24 ·
-
enhancement
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
EnAccess/OpenPAYGO-python#22 ·
-
documentation enhancement good first issue hacktoberfest help wanted
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
EnAccess/OpenPAYGO-python#15 ·
Tất cả issue của EnAccess/OpenPAYGO-python
Issue tương tự
-
agent-ready documentation needs-triage
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
-
documentation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 91/100
-
workflow-status page template still says reusable workflows are "triggered only by workflow_call:" Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
-
Add https://search.jeremyh.xyz/ Đang mởinstance instance add
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
searxng/searx-instances#939 · 1 bình luận ·
-
area-deployment area-integrations triage:bot-seen
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 86/100