PHP Class Stichoza\GoogleTranslate\Tokens\GoogleTokenGenerator

Thanks to @helen5106 and @tehmaestro and few other cool guys at https://github.com/Stichoza/google-translate-php/issues/32
Inheritance: implements Stichoza\GoogleTranslate\Tokens\TokenProviderInterface
Show file Open project: stichoza/google-translate-php

Public Methods

Method Description
generateToken ( string $source, string $target, string $text ) : mixed Generate and return a token.

Private Methods

Method Description
RL ( $a, $b ) : integer Process token data by applying multiple operations.
TKK ( ) : array
TL ( string $a ) : string Generate a valid Google Translate request token.
charCodeAt ( string $str, integer $index ) : null | number Get the Unicode of the character at the specified index in a string.
shr32 ( $x, $bits ) : number Crypto function.

Method Details

generateToken() public method

Generate and return a token.
public generateToken ( string $source, string $target, string $text ) : mixed
$source string Source language
$target string Target language
$text string Text to translate
return mixed A token