| Index: remoting/host/setup/pin_validator.cc
|
| diff --git a/remoting/host/setup/pin_validator.cc b/remoting/host/setup/pin_validator.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..ce753a4a50ab9c4fecc65b57cb34360039c2261e
|
| --- /dev/null
|
| +++ b/remoting/host/setup/pin_validator.cc
|
| @@ -0,0 +1,20 @@
|
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "remoting/host/setup/pin_validator.h"
|
| +
|
| +namespace remoting {
|
| +
|
| +bool IsPinValid(const std::string& pin) {
|
| + if (pin.length() < 6)
|
| + return false;
|
| + for (size_t i = 0; i < pin.length(); i++) {
|
| + char c = pin[i];
|
| + if (c < '0' || c > '9')
|
| + return false;
|
| + }
|
| + return true;
|
| +}
|
| +
|
| +} // namespace remoting
|
|
|