We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 99d3bdf commit 11f5c48Copy full SHA for 11f5c48
2 files changed
src/index.ts
@@ -113,6 +113,7 @@ export {
113
uuidToBytes,
114
bytesToUuid,
115
mnemonicToBytes,
116
+ bytesToMnemonic,
117
} from './utils';
118
export * from './types';
119
export * from './constants';
src/utils/genMnemonic.ts
@@ -20,3 +20,13 @@ export function genMnemonic(bits: number): string {
20
export function mnemonicToBytes(mnemonic: string): Uint8Array {
21
return bip39.mnemonicToEntropy(mnemonic, wordlist);
22
}
23
+
24
+/**
25
+ * Converts a Uint8Array to a mnemonic
26
+ *
27
+ * @param bytes - The bytes to convert
28
+ * @returns The mnemonic string
29
+ */
30
+export function bytesToMnemonic(bytes: Uint8Array): string {
31
+ return bip39.entropyToMnemonic(bytes, wordlist);
32
+}
0 commit comments