Skip to content

Commit

Permalink
Merge pull request #1 from marconett/patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
SRWieZ authored Mar 24, 2023
2 parents 0cfc704 + 2fa9d58 commit bb4076a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Thumbhash.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ public static function convertHashToString(array $hash): string
return rtrim(base64_encode(implode(array_map("chr", $hash))), '=');
}

public static function convertStringToHash(string $str): array
{
return array_map("ord", str_split(base64_decode($str . "=")));
}

/**
* Decodes a ThumbHash to an RGBA image. RGB is not premultiplied by A.
Expand Down

0 comments on commit bb4076a

Please sign in to comment.