CircuitString
SnarkyJS / Modules / CircuitString
Class: CircuitString
Deprecated
CircuitValue
is deprecated in favor of Struct, which features a simpler API and better typing.
Hierarchy
↳
CircuitString
Table of contents
Constructors
Properties
Methods
- append
- assertEquals
- computeLengthAndMask
- equals
- hash
- isConstant
- length
- lengthMask
- maxLength
- substring
- toConstant
- toFields
- toJSON
- toString
- check
- fromCharacters
- fromFields
- fromJSON
- fromObject
- fromString
- sizeInFields
- toAuxiliary
- toConstant
- toFields
- toInput
- toJSON
Constructors
constructor
• Private
new CircuitString(values
)
Parameters
Name | Type |
---|---|
values | Character [] |
Overrides
Defined in
Properties
values
• values: Character
[]
Defined in
maxLength
▪ Static
maxLength: number
= DEFAULT_STRING_LENGTH
Defined in
Methods
append
▸ append(str
): CircuitString
appends another string to this one, returns the result and proves that it fits
within the maxLength
of this string (the other string can have a different maxLength)
Parameters
Name | Type |
---|---|
str | CircuitString |
Returns
Defined in
assertEquals
▸ assertEquals(x
): void
Parameters
Name | Type |
---|---|
x | CircuitString |
Returns
void
Inherited from
Defined in
computeLengthAndMask
▸ Private
computeLengthAndMask(): Object
Returns
Object
Name | Type |
---|---|
length | Field |
mask | Bool [] |
Defined in
equals
▸ equals(x
): Bool
Parameters
Name | Type |
---|---|
x | CircuitString |
Returns
Inherited from
Defined in
hash
▸ hash(): Field
returns true if str
is found in this CircuitString
Returns
Defined in
isConstant
▸ isConstant(): boolean
Returns
boolean
Inherited from
Defined in
length
▸ Private
length(): Field
Returns
Defined in
lengthMask
▸ Private
lengthMask(): Bool
[]
Returns
Bool
[]
Defined in
maxLength
▸ Private
maxLength(): number
Returns
number
Defined in
substring
▸ substring(start
, end
): CircuitString
Parameters
Name | Type |
---|---|
start | number |
end | number |
Returns
Defined in
toConstant
▸ toConstant(): CircuitString
Returns
Inherited from
Defined in
toFields
▸ toFields(): Field
[]
Returns
Field
[]
Inherited from
Defined in
toJSON
▸ toJSON(): any
Returns
any
Inherited from
Defined in
toString
▸ toString(): string
Returns
string
Defined in
check
▸ Static
check<T
>(this
, v
): void
Type parameters
Name | Type |
---|---|
T | extends AnyConstructor |
Parameters
Name | Type |
---|---|
this | T |
v | InstanceType <T > |
Returns
void
Inherited from
Defined in
fromCharacters
▸ Static
fromCharacters(chars
): CircuitString
Parameters
Name | Type |
---|---|
chars | Character [] |
Returns
Defined in
fromFields
▸ Static
fromFields<T
>(this
, xs
): InstanceType
<T
>
Type parameters
Name | Type |
---|---|
T | extends AnyConstructor |
Parameters
Name | Type |
---|---|
this | T |
xs | Field [] |
Returns
InstanceType
<T
>
Inherited from
Defined in
fromJSON
▸ Static
fromJSON<T
>(this
, value
): InstanceType
<T
>
Type parameters
Name | Type |
---|---|
T | extends AnyConstructor |
Parameters
Name | Type |
---|---|
this | T |
value | any |
Returns
InstanceType
<T
>
Inherited from
Defined in
fromObject
▸ Static
fromObject<T
>(this
, value
): InstanceType
<T
>
Type parameters
Name | Type |
---|---|
T | extends AnyConstructor |
Parameters
Name | Type |
---|---|
this | T |
value | NonMethods <InstanceType <T >> |
Returns
InstanceType
<T
>
Inherited from
Defined in
fromString
▸ Static
fromString(str
): CircuitString
Parameters
Name | Type |
---|---|
str | string |
Returns
Defined in
sizeInFields
▸ Static
sizeInFields(): number
Returns
number
Inherited from
Defined in
toAuxiliary
▸ Static
toAuxiliary(): []
Returns
[]
Inherited from
Defined in
toConstant
▸ Static
toConstant<T
>(this
, t
): InstanceType
<T
>
Type parameters
Name | Type |
---|---|
T | extends AnyConstructor |
Parameters
Name | Type |
---|---|
this | T |
t | InstanceType <T > |
Returns
InstanceType
<T
>
Inherited from
Defined in
toFields
▸ Static
toFields<T
>(this
, v
): Field
[]
Type parameters
Name | Type |
---|---|
T | extends AnyConstructor |
Parameters
Name | Type |
---|---|
this | T |
v | InstanceType <T > |
Returns
Field
[]
Inherited from
Defined in
toInput
▸ Static
toInput<T
>(this
, v
): HashInput
Type parameters
Name | Type |
---|---|
T | extends AnyConstructor |
Parameters
Name | Type |
---|---|
this | T |
v | InstanceType <T > |
Returns
HashInput
Inherited from
Defined in
toJSON
▸ Static
toJSON<T
>(this
, v
): any
Type parameters
Name | Type |
---|---|
T | extends AnyConstructor |
Parameters
Name | Type |
---|---|
this | T |
v | InstanceType <T > |
Returns
any