- hash: documentation ( source)
- strtr: documentation ( source)
- implode: documentation ( source)
- base64_encode: documentation ( source)
<?php
$table = 'user_field_data';
$index = 'a_veeeery_veery_very_super_long_field_name__key';
$data = implode('__', [$table, $index]);
echo strtr(base64_encode(hash('sha256', $data, TRUE)), ['+' => '_', '/' => '_', '=' => '']);