Socket
Socket
Sign inDemoInstall

@ethersproject/hash

Package Overview
Dependencies
25
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.5.0 to 5.6.0

2

lib.esm/_version.d.ts

@@ -1,2 +0,2 @@

export declare const version = "hash/5.5.0";
export declare const version = "hash/5.6.0";
//# sourceMappingURL=_version.d.ts.map

@@ -1,2 +0,2 @@

export const version = "hash/5.5.0";
export const version = "hash/5.6.0";
//# sourceMappingURL=_version.js.map
import { id } from "./id";
import { isValidName, namehash } from "./namehash";
import { dnsEncode, isValidName, namehash } from "./namehash";
import { hashMessage, messagePrefix } from "./message";
import { TypedDataEncoder as _TypedDataEncoder } from "./typed-data";
export { id, namehash, isValidName, messagePrefix, hashMessage, _TypedDataEncoder, };
export { id, dnsEncode, namehash, isValidName, messagePrefix, hashMessage, _TypedDataEncoder, };
//# sourceMappingURL=index.d.ts.map
"use strict";
import { id } from "./id";
import { isValidName, namehash } from "./namehash";
import { dnsEncode, isValidName, namehash } from "./namehash";
import { hashMessage, messagePrefix } from "./message";
import { TypedDataEncoder as _TypedDataEncoder } from "./typed-data";
export { id, namehash, isValidName, messagePrefix, hashMessage, _TypedDataEncoder, };
export { id, dnsEncode, namehash, isValidName, messagePrefix, hashMessage, _TypedDataEncoder, };
//# sourceMappingURL=index.js.map
export declare function isValidName(name: string): boolean;
export declare function namehash(name: string): string;
export declare function dnsEncode(name: string): string;
//# sourceMappingURL=namehash.d.ts.map

@@ -41,2 +41,11 @@ import { concat, hexlify } from "@ethersproject/bytes";

}
export function dnsEncode(name) {
return hexlify(concat(name.split(".").map((comp) => {
// We jam in an _ prefix to fill in with the length later
// Note: Nameprep throws if the component is over 63 bytes
const bytes = toUtf8Bytes("_" + nameprep(comp));
bytes[0] = bytes.length - 1;
return bytes;
}))) + "00";
}
//# sourceMappingURL=namehash.js.map

@@ -1,2 +0,2 @@

export declare const version = "hash/5.5.0";
export declare const version = "hash/5.6.0";
//# sourceMappingURL=_version.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = void 0;
exports.version = "hash/5.5.0";
exports.version = "hash/5.6.0";
//# sourceMappingURL=_version.js.map
import { id } from "./id";
import { isValidName, namehash } from "./namehash";
import { dnsEncode, isValidName, namehash } from "./namehash";
import { hashMessage, messagePrefix } from "./message";
import { TypedDataEncoder as _TypedDataEncoder } from "./typed-data";
export { id, namehash, isValidName, messagePrefix, hashMessage, _TypedDataEncoder, };
export { id, dnsEncode, namehash, isValidName, messagePrefix, hashMessage, _TypedDataEncoder, };
//# sourceMappingURL=index.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports._TypedDataEncoder = exports.hashMessage = exports.messagePrefix = exports.isValidName = exports.namehash = exports.id = void 0;
exports._TypedDataEncoder = exports.hashMessage = exports.messagePrefix = exports.isValidName = exports.namehash = exports.dnsEncode = exports.id = void 0;
var id_1 = require("./id");
Object.defineProperty(exports, "id", { enumerable: true, get: function () { return id_1.id; } });
var namehash_1 = require("./namehash");
Object.defineProperty(exports, "dnsEncode", { enumerable: true, get: function () { return namehash_1.dnsEncode; } });
Object.defineProperty(exports, "isValidName", { enumerable: true, get: function () { return namehash_1.isValidName; } });

@@ -8,0 +9,0 @@ Object.defineProperty(exports, "namehash", { enumerable: true, get: function () { return namehash_1.namehash; } });

export declare function isValidName(name: string): boolean;
export declare function namehash(name: string): string;
export declare function dnsEncode(name: string): string;
//# sourceMappingURL=namehash.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.namehash = exports.isValidName = void 0;
exports.dnsEncode = exports.namehash = exports.isValidName = void 0;
var bytes_1 = require("@ethersproject/bytes");

@@ -46,2 +46,12 @@ var strings_1 = require("@ethersproject/strings");

exports.namehash = namehash;
function dnsEncode(name) {
return (0, bytes_1.hexlify)((0, bytes_1.concat)(name.split(".").map(function (comp) {
// We jam in an _ prefix to fill in with the length later
// Note: Nameprep throws if the component is over 63 bytes
var bytes = (0, strings_1.toUtf8Bytes)("_" + (0, strings_1.nameprep)(comp));
bytes[0] = bytes.length - 1;
return bytes;
}))) + "00";
}
exports.dnsEncode = dnsEncode;
//# sourceMappingURL=namehash.js.map
{
"author": "Richard Moore <me@ricmoo.com>",
"dependencies": {
"@ethersproject/abstract-signer": "^5.5.0",
"@ethersproject/address": "^5.5.0",
"@ethersproject/bignumber": "^5.5.0",
"@ethersproject/bytes": "^5.5.0",
"@ethersproject/keccak256": "^5.5.0",
"@ethersproject/logger": "^5.5.0",
"@ethersproject/properties": "^5.5.0",
"@ethersproject/strings": "^5.5.0"
"@ethersproject/abstract-signer": "^5.6.0",
"@ethersproject/address": "^5.6.0",
"@ethersproject/bignumber": "^5.6.0",
"@ethersproject/bytes": "^5.6.0",
"@ethersproject/keccak256": "^5.6.0",
"@ethersproject/logger": "^5.6.0",
"@ethersproject/properties": "^5.6.0",
"@ethersproject/strings": "^5.6.0"
},

@@ -25,3 +25,3 @@ "description": "Hash utility functions for Ethereum.",

],
"gitHead": "73a46efea32c3f9a4833ed77896a216e3d3752a0",
"gitHead": "b8cda5dffdcb688e38d7c6a0aec4c7b8b59c1af5",
"keywords": [

@@ -47,5 +47,5 @@ "Ethereum",

"sideEffects": false,
"tarballHash": "0x7d9a6d1808386f7963885e757b739ee981616a16bc1f479d43278be9611e9cc1",
"tarballHash": "0x23b00b87b17191eace6450fd824e0f816a3c3dfbdbacd0a904f67b5be5b43984",
"types": "./lib/index.d.ts",
"version": "5.5.0"
"version": "5.6.0"
}

@@ -1,1 +0,1 @@

export const version = "hash/5.5.0";
export const version = "hash/5.6.0";
"use strict";
import { id } from "./id";
import { isValidName, namehash } from "./namehash";
import { dnsEncode, isValidName, namehash } from "./namehash";
import { hashMessage, messagePrefix } from "./message";

@@ -12,2 +12,3 @@

dnsEncode,
namehash,

@@ -14,0 +15,0 @@ isValidName,

@@ -49,1 +49,10 @@ import { concat, hexlify } from "@ethersproject/bytes";

export function dnsEncode(name: string): string {
return hexlify(concat(name.split(".").map((comp) => {
// We jam in an _ prefix to fill in with the length later
// Note: Nameprep throws if the component is over 63 bytes
const bytes = toUtf8Bytes("_" + nameprep(comp));
bytes[0] = bytes.length - 1;
return bytes;
}))) + "00";
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc