CryptoAlgorithms: make CryptographicAlgorithm#matchesName split on underscores

This commit is contained in:
Alex Ford 2023-02-02 20:20:03 +00:00
Родитель 983055b8f9
Коммит 1435ef1862
3 изменённых файлов: 6 добавлений и 6 удалений

Просмотреть файл

@ -40,12 +40,12 @@ abstract class CryptographicAlgorithm extends TCryptographicAlgorithm {
/**
* Holds if the name of this algorithm matches `name` modulo case,
* white space, dashes, underscores, and anything after a dash in the name
* white space, dashes, underscores, and anything after a dash or underscore in the name
* (to ignore modes of operation, such as CBC or ECB).
*/
bindingset[name]
predicate matchesName(string name) {
[name.toUpperCase(), name.toUpperCase().regexpCapture("^(\\w+)(?:-.*)?$", 1)]
[name.toUpperCase(), name.toUpperCase().regexpCapture("^([A-Z0-9]+)(?:(-|_).*)?$", 1)]
.regexpReplaceAll("[-_ ]", "") = getName()
}

Просмотреть файл

@ -40,12 +40,12 @@ abstract class CryptographicAlgorithm extends TCryptographicAlgorithm {
/**
* Holds if the name of this algorithm matches `name` modulo case,
* white space, dashes, underscores, and anything after a dash in the name
* white space, dashes, underscores, and anything after a dash or underscore in the name
* (to ignore modes of operation, such as CBC or ECB).
*/
bindingset[name]
predicate matchesName(string name) {
[name.toUpperCase(), name.toUpperCase().regexpCapture("^(\\w+)(?:-.*)?$", 1)]
[name.toUpperCase(), name.toUpperCase().regexpCapture("^([A-Z0-9]+)(?:(-|_).*)?$", 1)]
.regexpReplaceAll("[-_ ]", "") = getName()
}

Просмотреть файл

@ -40,12 +40,12 @@ abstract class CryptographicAlgorithm extends TCryptographicAlgorithm {
/**
* Holds if the name of this algorithm matches `name` modulo case,
* white space, dashes, underscores, and anything after a dash in the name
* white space, dashes, underscores, and anything after a dash or underscore in the name
* (to ignore modes of operation, such as CBC or ECB).
*/
bindingset[name]
predicate matchesName(string name) {
[name.toUpperCase(), name.toUpperCase().regexpCapture("^(\\w+)(?:-.*)?$", 1)]
[name.toUpperCase(), name.toUpperCase().regexpCapture("^([A-Z0-9]+)(?:(-|_).*)?$", 1)]
.regexpReplaceAll("[-_ ]", "") = getName()
}