[Bug]: Discrepancy of extended Token with legacy library
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Inizia eseguendo gli esempi Python nell’issue e confronta OpenPAYGOTokenEncoder.generate_token con il legacy generate_extended_token per un token ADD_TIME esteso. Traccia il modo in cui il tipo e il conteggio del token vengono gestiti in modalità estesa, quindi verifica il risultato rispetto all’output legacy o a un comportamento atteso confermato esplicitamente. L’issue non indica file o test del repository.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- Python
- Stelle
- 15
- Fork
- 15
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di EnAccess/OpenPAYGO-python
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
EnAccess/OpenPAYGO-python#34 ·
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
EnAccess/OpenPAYGO-python#25 ·
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
EnAccess/OpenPAYGO-python#24 ·
-
enhancement
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
EnAccess/OpenPAYGO-python#22 ·
-
documentation enhancement good first issue hacktoberfest help wanted
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
EnAccess/OpenPAYGO-python#15 ·
Tutte le issue di EnAccess/OpenPAYGO-python
Issue simili
-
essnmx good first issue
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
-
[Feature] 奇物选择添加优先级 Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
syfoud/Simulated_Scepter#174 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Giskard-AI/giskard-oss#2840 · 1 commento ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success Apertaarea: repo bug perceived difficulty: 2
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
yeti-platform/yeti#1380 ·