cafe-utility 26.7.0 → 26.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +3 -2
- package/index.js +7 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -512,6 +512,7 @@ declare function commonPrefix(one: Uint8Array, other: Uint8Array): Uint8Array;
|
|
|
512
512
|
declare function setBit(bytes: Uint8Array, index: number, value: 0 | 1): void;
|
|
513
513
|
declare function getBit(bytes: Uint8Array, index: number): 0 | 1;
|
|
514
514
|
declare function binaryIndexOf(array: Uint8Array, value: Uint8Array, start?: number): number;
|
|
515
|
+
declare function binaryEquals(a: Uint8Array, b: Uint8Array): boolean;
|
|
515
516
|
declare function privateKeyToPublicKey(privateKey: bigint): [bigint, bigint];
|
|
516
517
|
declare function publicKeyToAddress(publicKey: [bigint, bigint]): Uint8Array;
|
|
517
518
|
declare function signMessage(message: Uint8Array, privateKey: bigint, nonce?: bigint): [bigint, bigint, 27n | 28n];
|
|
@@ -631,6 +632,7 @@ export declare const Binary: {
|
|
|
631
632
|
setBit: typeof setBit;
|
|
632
633
|
getBit: typeof getBit;
|
|
633
634
|
indexOf: typeof binaryIndexOf;
|
|
635
|
+
equals: typeof binaryEquals;
|
|
634
636
|
};
|
|
635
637
|
export declare const Elliptic: {
|
|
636
638
|
privateKeyToPublicKey: typeof privateKeyToPublicKey;
|
|
@@ -983,5 +985,4 @@ export declare const Vector: {
|
|
|
983
985
|
raycastCircle: typeof raycastCircle;
|
|
984
986
|
getLineIntersectionPoint: typeof getLineIntersectionPoint;
|
|
985
987
|
};
|
|
986
|
-
export {
|
|
987
|
-
|
|
988
|
+
export {};
|
package/index.js
CHANGED
|
@@ -2452,6 +2452,11 @@ function binaryIndexOf(n, e, t = 0) {
|
|
|
2452
2452
|
for (let o = 0; o < e.length && n[r + o] === e[o]; o++) if (o === e.length - 1) return r
|
|
2453
2453
|
return -1
|
|
2454
2454
|
}
|
|
2455
|
+
function binaryEquals(n, e) {
|
|
2456
|
+
if (n.length !== e.length) return !1
|
|
2457
|
+
for (let t = 0; t < n.length; t++) if (n[t] !== e[t]) return !1
|
|
2458
|
+
return !0
|
|
2459
|
+
}
|
|
2455
2460
|
function mod(n, e) {
|
|
2456
2461
|
return ((n % e) + e) % e
|
|
2457
2462
|
}
|
|
@@ -2919,7 +2924,8 @@ class AsyncQueue {
|
|
|
2919
2924
|
commonPrefix,
|
|
2920
2925
|
setBit,
|
|
2921
2926
|
getBit,
|
|
2922
|
-
indexOf: binaryIndexOf
|
|
2927
|
+
indexOf: binaryIndexOf,
|
|
2928
|
+
equals: binaryEquals
|
|
2923
2929
|
}),
|
|
2924
2930
|
(exports.Elliptic = {
|
|
2925
2931
|
privateKeyToPublicKey,
|