@mysten/zklogin
Advanced tools
Comparing version 0.0.0-experimental-20230817171212 to 0.0.0-experimental-20230817191944
# @mysten/zklogin | ||
## 0.0.0-experimental-20230817171212 | ||
## 0.0.0-experimental-20230817191944 | ||
### Patch Changes | ||
- b676fa4e9: Change function signature of genAddrSeed | ||
- 626098033: Fix generated types | ||
@@ -8,0 +9,0 @@ - 608e8e407: Update max key claim value length |
@@ -15,2 +15,2 @@ /// <reference types="node" /> | ||
export declare function hashASCIIStrToField(str: string, maxSize: number): bigint; | ||
export declare function genAddressSeed(pin: bigint, name: string, value: string): bigint; | ||
export declare function genAddressSeed(pin: bigint, name: string, value: string, max_name_length?: number, max_value_length?: number): bigint; |
@@ -68,6 +68,6 @@ "use strict"; | ||
} | ||
function genAddressSeed(pin, name, value) { | ||
function genAddressSeed(pin, name, value, max_name_length = MAX_KEY_CLAIM_NAME_LENGTH, max_value_length = MAX_KEY_CLAIM_VALUE_LENGTH) { | ||
return (0, import_poseidon.poseidonHash)([ | ||
hashASCIIStrToField(name, MAX_KEY_CLAIM_NAME_LENGTH), | ||
hashASCIIStrToField(value, MAX_KEY_CLAIM_VALUE_LENGTH), | ||
hashASCIIStrToField(name, max_name_length), | ||
hashASCIIStrToField(value, max_value_length), | ||
(0, import_poseidon.poseidonHash)([pin]) | ||
@@ -74,0 +74,0 @@ ]); |
@@ -15,2 +15,2 @@ /// <reference types="node" /> | ||
export declare function hashASCIIStrToField(str: string, maxSize: number): bigint; | ||
export declare function genAddressSeed(pin: bigint, name: string, value: string): bigint; | ||
export declare function genAddressSeed(pin: bigint, name: string, value: string, max_name_length?: number, max_value_length?: number): bigint; |
@@ -41,6 +41,6 @@ import { poseidonHash } from "./poseidon.js"; | ||
} | ||
function genAddressSeed(pin, name, value) { | ||
function genAddressSeed(pin, name, value, max_name_length = MAX_KEY_CLAIM_NAME_LENGTH, max_value_length = MAX_KEY_CLAIM_VALUE_LENGTH) { | ||
return poseidonHash([ | ||
hashASCIIStrToField(name, MAX_KEY_CLAIM_NAME_LENGTH), | ||
hashASCIIStrToField(value, MAX_KEY_CLAIM_VALUE_LENGTH), | ||
hashASCIIStrToField(name, max_name_length), | ||
hashASCIIStrToField(value, max_value_length), | ||
poseidonHash([pin]) | ||
@@ -47,0 +47,0 @@ ]); |
{ | ||
"name": "@mysten/zklogin", | ||
"version": "0.0.0-experimental-20230817171212", | ||
"version": "0.0.0-experimental-20230817191944", | ||
"description": "Utilities for interacting with zkLogin in Sui", | ||
@@ -5,0 +5,0 @@ "license": "Apache-2.0", |
@@ -72,8 +72,14 @@ // Copyright (c) Mysten Labs, Inc. | ||
export function genAddressSeed(pin: bigint, name: string, value: string) { | ||
export function genAddressSeed( | ||
pin: bigint, | ||
name: string, | ||
value: string, | ||
max_name_length = MAX_KEY_CLAIM_NAME_LENGTH, | ||
max_value_length = MAX_KEY_CLAIM_VALUE_LENGTH, | ||
) { | ||
return poseidonHash([ | ||
hashASCIIStrToField(name, MAX_KEY_CLAIM_NAME_LENGTH), | ||
hashASCIIStrToField(value, MAX_KEY_CLAIM_VALUE_LENGTH), | ||
hashASCIIStrToField(name, max_name_length), | ||
hashASCIIStrToField(value, max_value_length), | ||
poseidonHash([pin]), | ||
]); | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
145108
883