mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-24 21:39:24 +00:00
18 lines
322 B
QML
18 lines
322 B
QML
pragma Singleton
|
|
|
|
import QtQuick 2.13
|
|
|
|
QtObject {
|
|
function isHex(value) {
|
|
return /^[0-9a-f]*$/i.test(value)
|
|
}
|
|
|
|
function startsWith0x(value) {
|
|
return value.startsWith('0x')
|
|
}
|
|
|
|
function isChatKey(value) {
|
|
return startsWith0x(value) && isHex(value) && value.length === 132
|
|
}
|
|
}
|