Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F101466447
sha1.js
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Feb 10, 17:57
Size
284 B
Mime Type
text/x-java
Expires
Wed, Feb 12, 17:57 (2 d)
Engine
blob
Format
Raw Data
Handle
24154008
Attached To
rOACCT Open Access Compliance Check Tool (OACCT)
sha1.js
View Options
import
crypto
from
'crypto'
;
function
sha1
(
bytes
)
{
if
(
Array
.
isArray
(
bytes
))
{
bytes
=
Buffer
.
from
(
bytes
);
}
else
if
(
typeof
bytes
===
'string'
)
{
bytes
=
Buffer
.
from
(
bytes
,
'utf8'
);
}
return
crypto
.
createHash
(
'sha1'
).
update
(
bytes
).
digest
();
}
export
default
sha1
;
Event Timeline
Log In to Comment