daku 0.0.3 → 0.0.4
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/package.json +2 -2
- package/username.js +6 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "daku",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "Leave no trace. Just authenticate.",
|
|
5
5
|
"homepage": "https://github.com/besoeasy/daku#readme",
|
|
6
6
|
"keywords": [
|
|
@@ -47,4 +47,4 @@
|
|
|
47
47
|
"scripts": {
|
|
48
48
|
"test": "node test.js"
|
|
49
49
|
}
|
|
50
|
-
}
|
|
50
|
+
}
|
package/username.js
CHANGED
|
@@ -8028,13 +8028,14 @@ const verbs = [
|
|
|
8028
8028
|
"detriments",
|
|
8029
8029
|
];
|
|
8030
8030
|
|
|
8031
|
-
import {
|
|
8031
|
+
import { sha256 as nobleSha256 } from "@noble/hashes/sha2";
|
|
8032
8032
|
|
|
8033
8033
|
export async function generateAccountIdentifier(input) {
|
|
8034
|
-
|
|
8035
|
-
|
|
8036
|
-
|
|
8037
|
-
|
|
8034
|
+
// Convert input string to Uint8Array if it's a string
|
|
8035
|
+
const inputBytes = typeof input === 'string'
|
|
8036
|
+
? new TextEncoder().encode(input)
|
|
8037
|
+
: input;
|
|
8038
|
+
const hash = sha256(inputBytes);
|
|
8038
8039
|
|
|
8039
8040
|
// Adjective: bytes 0-1 (16 bits = 0-65535)
|
|
8040
8041
|
const adjIndex = ((hash[0] << 8) | hash[1]) >>> 0;
|