The code samples convert "lifeTime" of the token (in minutes) to "expiryTime" (the Unix epoch timestamp representing the exact second the token will expire). This means the code generated will be different every time you calculate it even if you input the same values (the lifeTime is converted to seconds and added to the current epoch time). You can check your output by testing with a specific expiryTime instead of calculating it.


You can test your HMAC-implementation with the following parameters:

Parameter
videoId212zpS6bjN77eixPUMUEjR
sharedSecretabc123
expiryTime1458396066


The following signature should be calculated with these parameters:

1458396066~62dcbe0e20827245454280c51129a9f30d1122eaeafc5ce88f0fec527631f1b5