私はnodejsとnowjsを使用しています。サーバー上の関数を呼び出している関数の本体の長さを取得し、同じかどうかを確認したい。ユーザーがクライアント側の機能を操作できないようにするため。そして、変更される可能性のある変数を除外する可能性があります。JavaScriptでこれを行う方法はありますか?
例えば
クライアント
now.sendMessage() {
//Some code...
}
サーバ
everyone.now.sendMessage() {
//Check that the code is the exact length
//as the function body written in the clientside script
//To see if it has been manipulated...
if (codelength === ?) {
//execute code
} else {
//return error
}
}