MCPcopy Create free account
hub / github.com/cryptii/cryptii / constructor

Method constructor

src/Field/Byte.js:16–27  ·  view source on GitHub ↗

* Constructor * @param {string} name Field name * @param {Object} [spec] Field spec * @param {?number} [spec.minSize=null] Minimum size in bytes * @param {?number} [spec.maxSize=null] Maximum size in bytes

(name, spec = {})

Source from the content-addressed store, hash-verified

14 * @param {?number} [spec.maxSize=null] Maximum size in bytes
15 */
16 constructor (name, spec = {}) {
17 super(name, spec)
18 this._viewPrototype = ByteFieldView
19
20 this._value = spec.value || new Uint8Array()
21 this._minSize = null
22 this._maxSize = null
23 this._randomizeSize = spec.randomizeSize || null
24
25 this.setMinSize(spec.minSize || null, false)
26 this.setMaxSize(spec.maxSize || null, false)
27 }
28
29 /**
30 * Returns min size in bytes.

Callers

nothing calls this directly

Calls 2

setMinSizeMethod · 0.95
setMaxSizeMethod · 0.95

Tested by

no test coverage detected