main
Last change
on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
300 bytes
|
Line | |
---|
1 | import { createHash } from 'crypto';
|
---|
2 | function md5(bytes) {
|
---|
3 | if (Array.isArray(bytes)) {
|
---|
4 | bytes = Buffer.from(bytes);
|
---|
5 | }
|
---|
6 | else if (typeof bytes === 'string') {
|
---|
7 | bytes = Buffer.from(bytes, 'utf8');
|
---|
8 | }
|
---|
9 | return createHash('md5').update(bytes).digest();
|
---|
10 | }
|
---|
11 | export default md5;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.