コード例 #1
0
ファイル: crypto.php プロジェクト: noccy80/lepton-ng
<?php

ModuleManager::checkExtension('mcrypt');
abstract class CipherMode
{
    const CM_OBC = 'obc';
    const CM_ECB = 'ecb';
    const CM_CBC = 'cbc';
    const CM_CFB = 'cfb';
}
/**
 * @brief CryptoCipher class
 *
 * Encrypts and decrypts strings, possibly armored in base64. The data to
 * be encrypted is tagged with the length of the string as a 32bit unsigned
 * integer, allowing the string to be safely be decrypted back to its
 * original length and stripped of the PKCS7 padding.
 *
 * The rawencrypt() and rawdecrypt() methods does not do anything to pad
 * or unpad the data.
 */
class CryptoCipher
{
    private $iv;
    private $td;
    /**
     * Constructor, accepts the name of the cipher and the key to use.
     *
     * @param string $cipher The cipher to use
     * @param string $key The key to use for encrypting/decrypting
     * @param string $mode The cipher mode
コード例 #2
0
ファイル: uuid.php プロジェクト: noccy80/lepton-ng
<?php

ModuleManager::checkExtension('uuid');
/**
 * @class Uuid
 * @brief UUID generation
 * 
 * @author Christopher Vagnetoft <noccy.com>
 */
class Uuid
{
    const UUID_V1 = 1;
    const UUID_V2 = 2;
    const UUID_V3 = 3;
    const UUID_V4 = 4;
    const UUID_V5 = 5;
    const LENGTH = 36;
    ///< length of a UUID
    const USE_PECL_MAKE = 'make';
    const USE_PECL_CREATE = 'create';
    const USE_PHP = 'php';
    static $urand = null;
    static $uobject = null;
    static $init = false;
    private $version = null;
    private static $method = 'null';
    protected $uuid;
    public function __construct($version = Uuid::UUID_V4)
    {
        $this->uuid = Uuid::generate($version);
        $this->version = $version;
コード例 #3
0
ファイル: curses.php プロジェクト: noccy80/lepton-ng
<?php

ModuleManager::checkExtension('ncurses', true);
ModuleManager::load('lepton.ui.curses.application');
コード例 #4
0
ファイル: gtk.php プロジェクト: noccy80/lepton-ng
<?php

ModuleManager::checkExtension('php_gtk', true);