mirror of
https://github.com/sigmasternchen/axowall
synced 2025-03-15 08:38:55 +00:00
cleaner solution for toHex
This commit is contained in:
parent
90317f1650
commit
187a1a1743
1 changed files with 1 additions and 1 deletions
|
@ -7,7 +7,7 @@ declare global {
|
||||||
}
|
}
|
||||||
|
|
||||||
Uint8Array.prototype.toHex = function(): string {
|
Uint8Array.prototype.toHex = function(): string {
|
||||||
return [...this].map(c => (c >> 4).toString(16) + (c & 15).toString(16)).join("");
|
return [...this].map(c => c.toString(16).padStart(2, "0")).join("");
|
||||||
};
|
};
|
||||||
|
|
||||||
Uint8Array.prototype.hasPrefix = function(prefix: Uint8Array, bits: number): boolean {
|
Uint8Array.prototype.hasPrefix = function(prefix: Uint8Array, bits: number): boolean {
|
||||||
|
|
Loading…
Reference in a new issue