
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
secjs-hashcode
Advanced tools
Encoding for Contract Application Binary Interface (ABI), including function name and input paras, based on the rule https://solidity.readthedocs.io/en/develop/abi-spec.html
Encoding for Contract Application Binary Interface (ABI), including function name and input parameter values, based on the rule https://solidity.readthedocs.io/en/develop/abi-spec.html For further information in detail. Please refer to test cases and introduction in test/test.js.
[]
StringArray.<Dict>StringArray.<String>new HashCode(sFnName, aParaValue) Constructs an Encoder.
| Param | Type | Description |
|---|---|---|
| sFnName | String | The function name with the parenthesised list of parameter types. Parameter types are split by a single comma - no spaces are used. e.g. "sam(bytes,bool,uint[])" |
| aParaValue | Array.<Dict> | The array of input Parameter Values with its type. e.g. [{value: 'dave', type: 'bytes'}, {value: true, type: 'bool'}, {value: [1, 2, 3], type: 'uint[]'}] |
Example
const HashCode = require('../src/index')
const sFnName = 'sam(bytes,bool,uint[])'
const aParaValue = [{value: 'dave', type: 'bytes'}, {value: true, type: 'bool'}, {value: [1, 2, 3], type: 'uint[]'}]
const oHashCode = new HashCode(sFnName, aParaValue)
StringReturns the current Function Name information.
Example
const sFnName = oHashCode.getFnName()
Array.<Dict>Returns the current input parameter values information.
Example
const aParaValue = oHashCode.getParaValue()
Set the Function Name.
Example
const sFnName = 'sam(bytes,bool,uint[])'
oHashCode.setFnName(sFnName)
Set the input parameter values.
Example
const aParaValue = [{value: 'dave', type: 'bytes'}, {value: true, type: 'bool'}, {value: [1, 2, 3], type: 'uint[]'}]
oHashCode.setParaValue(aParaValue)
Run the encoding based on current function name information and input parameter values
Example
oHashCode.runHashCode(aParaValue)
StringReturns the endcoded Bytecode String.
Example
const sByteCode = oHashCode1.getHashCode()
/*
An example for the format of result:
"8be6524600000000000000000000000000000000000000000000000000000000000001230000000000000000000000000000000000000000000000000000000000000080313233343536373839300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000004560000000000000000000000000000000000000000000000000000000000000789000000000000000000000000000000000000000000000000000000000000000d48656c6c6f2c20776f726c642100000000000000000000000000000000000000"
*/
Array.<String>Returns the array of encoded result of each element to have a better look and check.
Example
const aHashCodeFragments = oHashCode1.getHashCodeFragments()
/*
An example for the format of result:
["8be65246",
"0000000000000000000000000000000000000000000000000000000000000123",
"0000000000000000000000000000000000000000000000000000000000000080",
"3132333435363738393000000000000000000000000000000000000000000000",
"00000000000000000000000000000000000000000000000000000000000000e0",
"0000000000000000000000000000000000000000000000000000000000000002",
"0000000000000000000000000000000000000000000000000000000000000456",
"0000000000000000000000000000000000000000000000000000000000000789",
"000000000000000000000000000000000000000000000000000000000000000d",
"48656c6c6f2c20776f726c642100000000000000000000000000000000000000"]
*/
Array.<String>Show the encoded result of each element row by row in console to have a better look and check.
Example
oHashCode1.showHashCodeFragments()
/*
An example for the console output:
8be65246
0000000000000000000000000000000000000000000000000000000000000123
0000000000000000000000000000000000000000000000000000000000000080
3132333435363738393000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000e0
0000000000000000000000000000000000000000000000000000000000000002
0000000000000000000000000000000000000000000000000000000000000456
0000000000000000000000000000000000000000000000000000000000000789
000000000000000000000000000000000000000000000000000000000000000d
48656c6c6f2c20776f726c642100000000000000000000000000000000000000
*/
FAQs
Encoding for Contract Application Binary Interface (ABI), including function name and input paras, based on the rule https://solidity.readthedocs.io/en/develop/abi-spec.html
We found that secjs-hashcode demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.