mirror of
https://github.com/RoboSats/robosats.git
synced 2025-07-17 00:03:13 +00:00
Merge pull request #2055 from RoboSats/anually-verify-ratings
Simplify nostr key generation
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
import { sha256 } from 'js-sha256';
|
||||
import { sha256 as sha256Hash } from '@noble/hashes/sha256';
|
||||
import { sha512 } from '@noble/hashes/sha512';
|
||||
import { Robot, Order, type Federation } from '.';
|
||||
import { roboidentitiesClient } from '../services/Roboidentities/Web';
|
||||
import { hexToBase91, validateTokenEntropy } from '../utils';
|
||||
@ -27,8 +28,8 @@ class Slot {
|
||||
const { hasEnoughEntropy, bitsEntropy, shannonEntropy } = validateTokenEntropy(token);
|
||||
const tokenSHA256 = hexToBase91(sha256(token));
|
||||
|
||||
const nostrHash = sha256Hash(this.token);
|
||||
this.nostrSecKey = new Uint8Array(nostrHash);
|
||||
const nostrHash = sha256Hash(sha512(this.token));
|
||||
this.nostrSecKey = nostrHash;
|
||||
const nostrPubKey = getPublicKey(this.nostrSecKey);
|
||||
this.nostrPubKey = nostrPubKey;
|
||||
|
||||
|
Reference in New Issue
Block a user