FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
bitcore/examples/PayToScriptHashAddress.js at master · deckar01/bitcore · GitHub
deckar01
bitcore
Repository navigation
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
bitcore
/
examples
/
PayToScriptHashAddress.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
17 lines (13 loc) · 490 Bytes
Breadcrumbs
bitcore
/
examples
/
PayToScriptHashAddress.js
Copy path
File metadata and controls
17 lines (13 loc) · 490 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
var
bitcore
=
require
(
'../bitcore'
)
;
var
Address
=
bitcore
.
Address
;
var
bitcoreUtil
=
bitcore
.
util
;
var
Script
=
bitcore
.
Script
;
var
network
=
bitcore
.
networks
.
livenet
;
var
script
=
''
;
// write down your script here
var
s
=
Script
.
fromHumanReadable
(
script
)
;
var
hash
=
bitcoreUtil
.
sha256ripe160
(
s
.
getBuffer
(
)
)
;
var
version
=
network
.
addressScript
;
var
addr
=
new
Address
(
version
,
hash
)
;
var
addrStr
=
addr
.
as
(
'base58'
)
;
// This outputs the "address" of thescript
console
.
log
(
addrStr
)
;
Back
|
FazBrowse Home
|
New Git URL