QMaskGenerator Class
QMaskGenerator 클래스는 사용자 정의 32비트 마스크 생성기를 위한 추상적 기반을 제공합니다. 더 보기...
Header: | #include <QMaskGenerator> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS WebSockets) target_link_libraries(mytarget PRIVATE Qt6::WebSockets) |
qmake: | QT += websockets |
상속합니다: | QObject |
공용 함수
QMaskGenerator(QObject *parent = nullptr) | |
virtual | ~QMaskGenerator() override |
virtual quint32 | nextMask() = 0 |
virtual bool | seed() = 0 |
상세 설명
RFC 6455에 명시된 웹소켓 사양은 클라이언트에서 서버로의 모든 통신을 마스킹할 것을 요구합니다. 이는 악의적인 스크립트가 잘못된 동작을 하는 프록시를 공격하는 것을 방지하기 위한 것입니다. 좋은 마스킹의 중요성에 대한 자세한 내용은 Lin-Shung Huang 외의 '재미와 이익을 위해 자신과 대화하기'를 참조하세요. 기본적으로 QWebSocket 은 상당히 안전한 QRandomGenerator::global()->generate() 함수를 사용합니다. 위 문서에 언급된 공격에 대한 최선의 대책은 보안 연결(wss://)을 통해 QWebSocket 을 사용하는 것입니다. 일반적으로 애플리케이션에서 타사 스크립트가 QWebSocket 에 액세스하지 못하도록 항상 주의하세요.
멤버 함수 문서
[explicit]
QMaskGenerator::QMaskGenerator(QObject *parent = nullptr)
주어진 옵션 QObject parent 을 사용하여 새 QMaskGenerator 객체를 생성합니다.
[override virtual noexcept]
QMaskGenerator::~QMaskGenerator()
QMaskGenerator 객체를 삭제합니다.
[pure virtual]
quint32 QMaskGenerator::nextMask()
새로운 무작위 32비트 마스크를 반환합니다. 무작위성은 마스크 생성에 사용된 RNG에 따라 달라집니다.
[pure virtual]
bool QMaskGenerator::seed()
랜덤라이저를 시드하여 QMaskGenerator 를 초기화합니다. seed()가 호출되지 않으면 기본 시드가 사용되거나 시드가 전혀 사용되지 않는 경우 서브클래스의 특정 구현에 따라 달라집니다. 시딩에 성공하면 참을 반환하고, 그렇지 않으면 거짓을 반환합니다.
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.