Skip to content

Commit

Permalink
perf: ⚡️ store script SHA1 as Uint8Array
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Jan 15, 2024
1 parent da3ad02 commit de38732
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ScriptRegistry.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import {createHash} from 'crypto';

export class Script {
public readonly sha1: string;
public readonly sha1: Uint8Array;

constructor(public readonly script: string) {
this.sha1 = createHash('sha1').update(script).digest('hex');
const hash = createHash('sha1').update(script).digest('hex');
this.sha1 = Buffer.from(hash);
}
}

Expand Down

0 comments on commit de38732

Please sign in to comment.