<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/privacy/dlp/v2/dlp.proto

namespace Google\Cloud\Dlp\V2\CryptoReplaceFfxFpeConfig;

use UnexpectedValueException;

/**
 * These are commonly used subsets of the alphabet that the FFX mode
 * natively supports. In the algorithm, the alphabet is selected using
 * the "radix". Therefore each corresponds to particular radix.
 *
 * Protobuf type <code>google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig.FfxCommonNativeAlphabet</code>
 */
class FfxCommonNativeAlphabet
{
    /**
     * Generated from protobuf enum <code>FFX_COMMON_NATIVE_ALPHABET_UNSPECIFIED = 0;</code>
     */
    const FFX_COMMON_NATIVE_ALPHABET_UNSPECIFIED = 0;
    /**
     * [0-9] (radix of 10)
     *
     * Generated from protobuf enum <code>NUMERIC = 1;</code>
     */
    const NUMERIC = 1;
    /**
     * [0-9A-F] (radix of 16)
     *
     * Generated from protobuf enum <code>HEXADECIMAL = 2;</code>
     */
    const HEXADECIMAL = 2;
    /**
     * [0-9A-Z] (radix of 36)
     *
     * Generated from protobuf enum <code>UPPER_CASE_ALPHA_NUMERIC = 3;</code>
     */
    const UPPER_CASE_ALPHA_NUMERIC = 3;
    /**
     * [0-9A-Za-z] (radix of 62)
     *
     * Generated from protobuf enum <code>ALPHA_NUMERIC = 4;</code>
     */
    const ALPHA_NUMERIC = 4;

    private static $valueToName = [
        self::FFX_COMMON_NATIVE_ALPHABET_UNSPECIFIED => 'FFX_COMMON_NATIVE_ALPHABET_UNSPECIFIED',
        self::NUMERIC => 'NUMERIC',
        self::HEXADECIMAL => 'HEXADECIMAL',
        self::UPPER_CASE_ALPHA_NUMERIC => 'UPPER_CASE_ALPHA_NUMERIC',
        self::ALPHA_NUMERIC => 'ALPHA_NUMERIC',
    ];

    public static function name($value)
    {
        if (!isset(self::$valueToName[$value])) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no name defined for value %s', __CLASS__, $value));
        }
        return self::$valueToName[$value];
    }


    public static function value($name)
    {
        $const = __CLASS__ . '::' . strtoupper($name);
        if (!defined($const)) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no value defined for name %s', __CLASS__, $name));
        }
        return constant($const);
    }
}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(FfxCommonNativeAlphabet::class, \Google\Cloud\Dlp\V2\CryptoReplaceFfxFpeConfig_FfxCommonNativeAlphabet::class);

