Skip to content

Commit aed5537

Browse files
committed
Add 4th example
1 parent 8d69399 commit aed5537

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

JavaScript/4-hex.js

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
'use strict';
2+
3+
const fs = require('fs');
4+
5+
const v8File = './3-file.dat';
6+
fs.readFile(v8File, (err, data) => {
7+
console.log(
8+
data
9+
.toString('hex')
10+
.toUpperCase()
11+
.split('')
12+
.map((c, i) => ((i % 2 !== 0) ? (c + ' ') : c))
13+
.join('')
14+
);
15+
});

0 commit comments

Comments
 (0)