\SM3\typesBitString

比特串 由0和1组成的二进制数字序列。 Class BitString

Summary

Methods
Properties
Constants
__construct()
is_bit_string()
__toString()
getString()
offsetGet()
offsetExists()
offsetSet()
offsetUnset()
No public properties found
No constants found
No protected methods found
$bit_string
N/A
str2bin()
No private properties found
N/A

Properties

$bit_string

$bit_string : string

Type

string — 一个比特串类型的变量

Methods

__construct()

__construct(  $string) 

BitString constructor.

Parameters

$string

string|\SM3\types\BitString|\SM3\types\Word|mixed

is_bit_string()

is_bit_string(string|\SM3\types\BitString|\SM3\types\Word  $string) : boolean

判断是否为比特串类型

Parameters

string|\SM3\types\BitString|\SM3\types\Word $string

Returns

boolean

__toString()

__toString() 

getString()

getString() : string

获取比特串的值

Returns

string

offsetGet()

offsetGet(  $offset) 

Parameters

$offset

offsetExists()

offsetExists(mixed  $offset) : boolean

Whether a offset exists

Parameters

mixed $offset

An offset to check for.

Returns

boolean —

true on success or false on failure.

The return value will be casted to boolean if non-boolean was returned.

offsetSet()

offsetSet(mixed  $offset, mixed  $value) : \SM3\types\BitString

Offset to set

Parameters

mixed $offset

The offset to assign the value to.

mixed $value

The value to set.

Returns

\SM3\types\BitString

offsetUnset()

offsetUnset(mixed  $offset) : void

Offset to unset

Parameters

mixed $offset

The offset to unset.

str2bin()

str2bin(  $str) : string

字符串转比特串

Parameters

$str

int|string 普通字符串

Returns

string —

转换为比特串