Encode Library



( ZN >= 1.0.0 )

A class used to create passwords and perform special encryption.

 

# Methods


String create ( Int $ count = 6 , String $ chars = 'alnum' )
String golden ( String $ data , String $ additional = 'default' )
String super ( String $ data )
String type ( String $ data , String $ type = 'md5' )

 

# Create ( ZN> = 1.0.0 )


Used to generate a random password.

Parameters

Int $ length = 8 Password length.
String $ chars = 'alnum' Which characters are used for encryption.
Options all, alnum, alpha / string , numeric, special
return String

Use of

echo Encode::create(10);
gj4zs6ke9 to 
echo Encode::create(8, 'numeric');
34923522
echo Encode::create(6, 'alpha');
kfdrax

 

# Special Characters ( ZN> = 5.3.35 )


As of the specified version, special characters can also be used in random encryption.

echo Encode::create(6, 'special');
& +! (= /

The all parameter now includes special characters. For this reason, the predefined value is set as alum .

echo Encode::create(6, 'all');
a5bn (P

 

# Golden ( ZN >= 1.0.0 )


Used to create a customized password.

Parameters

String $ data The data to be encrypted.
String $ additional = 'default' Password code.
return String

Use of

\Output::writeLine(Encode::golden('Example Data', 'xkey'));
\Output::writeLine(Encode::golden('Example Data', 'ykey'));
c5c386872f7cdeabd560a0bb331d1ab7
396e449bbf9ddc2929174dd105bcec23 

 

# Super ( ZN >= 1.0.0 )


Used to create a project-specific password. The original password is generated according to the key value in Config / Project.php setting file . Thus, security services are increased by using different passwords from different projects. The key value is predefined as ZN \ In :: defaultProjectKey () . We do not recommend changing.

Parameters

String $ data The data to be encrypted.
return String

Use of

\Output::writeLine(Encode::super('Example Data'));
c5c835386ed22272ab77f0d140d6eb87 

 

# Type ( ZN >= 1.0.0 )


Encryption is done according to the specified encryption algorithm.

Parameters

String $ data The data to be encrypted.
String $ type = 'md5' Algorithm type.
Species hash_algos () list, super and golden
return String

Use of

\Output::writeLine(Encode::type('Example Data', 'md5'));
\Output::writeLine(Encode::type('Example Data', 'sha1'));
\Output::writeLine(Encode::type('Example Data', 'tiger192,4'));
82855e89f2a92981d1f5578816579742
3eb000f2018951656c8c27c5dc2a37445d029128
1c331e2f125b192d5f8a270f0e753cb082d9aab95472a962