refactor: tighten backend and logic boundaries
This commit is contained in:
@@ -32,6 +32,3 @@ const buildTournamentSeedKey = (baseSeed: string, context: TournamentRngContext)
|
||||
|
||||
export const createTournamentRng = (baseSeed: string, context: TournamentRngContext): RandUtil =>
|
||||
new RandUtil(LiteHashDRBG.build(buildTournamentSeedKey(baseSeed, context)));
|
||||
|
||||
export const createTournamentSeedKey = (baseSeed: string, context: TournamentRngContext): string =>
|
||||
buildTournamentSeedKey(baseSeed, context);
|
||||
|
||||
@@ -26,7 +26,7 @@ function normalizeUint8Array(bytes: Uint8Array): Uint8Array<ArrayBuffer> {
|
||||
return out as Uint8Array<ArrayBuffer>;
|
||||
}
|
||||
|
||||
export function sha512Bytes(data: BytesLike): Uint8Array<ArrayBuffer> {
|
||||
function sha512Bytes(data: BytesLike): Uint8Array<ArrayBuffer> {
|
||||
const input = convertBytesLikeToUint8Array(data);
|
||||
if (nodeCreateHash) {
|
||||
const digest = nodeCreateHash('sha512').update(input).digest();
|
||||
|
||||
Reference in New Issue
Block a user