mirror of
https://github.com/pezkuwichain/pezkuwi-common.git
synced 2026-06-22 23:11:08 +00:00
chore: update to version 14.0.11 and align website URLs
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ed25519PairFromSecret = ed25519PairFromSecret;
|
||||
/**
|
||||
* @name ed25519PairFromSecret
|
||||
* @summary Creates a new public/secret keypair from a secret.
|
||||
* @description
|
||||
* Returns a object containing a `publicKey` & `secretKey` generated from the supplied secret.
|
||||
* @example
|
||||
* <BR>
|
||||
*
|
||||
* ```javascript
|
||||
* import { ed25519PairFromSecret } from '@pezkuwi/util-crypto';
|
||||
*
|
||||
* ed25519PairFromSecret(...); // => { secretKey: [...], publicKey: [...] }
|
||||
* ```
|
||||
*/
|
||||
function ed25519PairFromSecret(secretKey) {
|
||||
if (secretKey.length !== 64) {
|
||||
throw new Error('Invalid secretKey provided');
|
||||
}
|
||||
return {
|
||||
publicKey: secretKey.slice(32),
|
||||
secretKey
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user