sumchecker
Advanced tools
Comparing version 1.0.0 to 1.1.0
11
index.js
@@ -46,10 +46,16 @@ /* | ||
class ChecksumValidator { | ||
constructor (algorithm, checksumFilename) { | ||
constructor (algorithm, checksumFilename, options) { | ||
this.algorithm = algorithm | ||
this.checksumFilename = checksumFilename | ||
this.checksums = null | ||
if (options && options.defaultTextEncoding) { | ||
this.defaultTextEncoding = options.defaultTextEncoding | ||
} else { | ||
this.defaultTextEncoding = 'utf8' | ||
} | ||
} | ||
encoding (binary) { | ||
return binary ? 'binary' : 'utf8' | ||
return binary ? 'binary' : this.defaultTextEncoding | ||
} | ||
@@ -156,4 +162,5 @@ | ||
sumchecker.ChecksumParseError = ChecksumParseError | ||
sumchecker.ChecksumValidator = ChecksumValidator | ||
sumchecker.NoChecksumFoundError = NoChecksumFoundError | ||
module.exports = sumchecker |
@@ -5,2 +5,9 @@ # Changes by Version | ||
## [1.1.0] - 2016-09-06 | ||
### Added | ||
* Optional `defaultTextEncoding` parameter in the `ChecksumValidator` constructor | ||
* Access to the underlying `ChecksumValidator` class | ||
## [1.0.0] - 2016-09-05 | ||
@@ -10,2 +17,3 @@ | ||
[1.1.0]: https://github.com/malept/sumchecker/compare/v1.0.0...v1.1.0 | ||
[1.0.0]: https://github.com/malept/sumchecker/releases/tag/v1.0.0 |
{ | ||
"name": "sumchecker", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"author": "Mark Lee", | ||
@@ -5,0 +5,0 @@ "license": "Apache-2.0", |
25082
223