Initial upload to Gitea
This commit is contained in:
1 parent
78193254ad
commit
8478998cae
1485 files changed
+461025
-42348
No files matched your search
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* SPDX-FileCopyrightText: Copyright 2020 - 2026 grommunio GmbH
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
/**
|
||||
* Check whether a value is a non-empty string of hexadecimal digits.
|
||||
*
|
||||
* @param mixed $value
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_hex_string($value) {
|
||||
return is_string($value) && $value !== '' && ctype_xdigit($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether a value is a hex-encoded binary such as an entryid.
|
||||
*
|
||||
* @param mixed $value
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_hex_entryid($value) {
|
||||
return is_hex_string($value) && (strlen($value) % 2) === 0;
|
||||
}
|
||||
Reference in new issue
Block a user