feat: 实现联通话费余量只读面板
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package unicom
|
||||
|
||||
import (
|
||||
"math/big"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestEncryptPasswordPacksLittleEndian(t *testing.T) {
|
||||
modulus := "10001"
|
||||
exponent := "11"
|
||||
got, err := encryptPassword(exponent, modulus, "A")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
m := big.NewInt(65537)
|
||||
e := big.NewInt(17)
|
||||
block := big.NewInt(65)
|
||||
want := hexBlock(new(big.Int).Exp(block, e, m))
|
||||
if got != want {
|
||||
t.Fatalf("got %s want %s", got, want)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user